local bMats = {}
bMats.Glow1 = Material("sprites/orangecore2")
bMats.Glow2 = Material("effects/orangeflare1")

for _,mat in pairs(bMats) do
	mat:SetMaterialInt("$spriterendermode",9)
	mat:SetMaterialInt("$ignorez",1)
	mat:SetMaterialInt("$illumfactor",8) 	
end

local lMats = {}
lMats.Glow1 = Material("sprites/crystal_beam1")
lMats.Glow2 = Material("sprites/physbeam")
lMats.Glow3 = Material("sprites/orangelight1")

for _,mat in pairs(lMats) do
	mat:SetMaterialInt("$spriterendermode",9)
	mat:SetMaterialInt("$ignorez",1)
	mat:SetMaterialInt("$illumfactor",8) 	
end

/*---------------------------------------------------------
   Init( data table )
---------------------------------------------------------*/
function EFFECT:Init( data )

	self.StartPos 	= data:GetStart()	
	self.EndPos 	= data:GetOrigin()
	self.Multi 		= data:GetMagnitude()
	self.Normal		= data:GetNormal()
	self.Time 		= self.Normal.x	
	
	self.Entity:SetRenderBoundsWS( self.StartPos, self.EndPos )	
	
end

/*---------------------------------------------------------
   THINK
---------------------------------------------------------*/
function EFFECT:Think( )

	return false
    
end

/*---------------------------------------------------------
   Draw the effect
---------------------------------------------------------*/
function EFFECT:Render( )

	render.SetMaterial( lMats.Glow1 )	
   	render.DrawBeam( self.StartPos, self.EndPos, 32, 2*CurTime(), (2*CurTime())+(0.002*self.Multi), Color( 255, 255, 255, 255 ) )
   	
   	render.SetMaterial( lMats.Glow3 )	
   	render.DrawBeam( self.StartPos, self.EndPos, 64, 2*CurTime(), (2*CurTime())+(0.002*self.Multi), Color( 255, 255, 255, 255 ) )
   	
   	render.SetMaterial(	bMats.Glow1 )
   	render.DrawSprite(self.EndPos, 96, 96, Color(255, 255, 255, 255))
   	
   	render.SetMaterial( bMats.Glow1 )
   	render.DrawSprite(self.StartPos, 96, 96, Color(255, 255, 255, 255))    	
					 
end
